package com.zhanshen.controller;

import com.zhanshen.pojo.Personal;
import com.zhanshen.pojo.Result;
import com.zhanshen.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class PersonalController {


    @Autowired
    private PersonalService personalService;

    /**
     * 登录与注册
     * @param personal
     * @return
     */
    @RequestMapping("register")
    @ResponseBody
    public Result register(Personal personal){
        personalService.addUser(personal);

        return Result.ok();
    }

    /**
     * 修改个人信息
     * @param personal
     * @return
     */
    @RequestMapping("updateUser")
    @ResponseBody
    public Result updateUser(Personal personal){
        personalService.updateUser(personal);
        return Result.ok();
    }

    /**
     * 修改密码
     * @param personal
     * @return
     */
    @RequestMapping("updatePaw")
    @ResponseBody
    public Result updatePaw(Personal personal){
        personalService.updatePaw(personal);
        return Result.ok();
    }



}
